<%@ page language="java" contentType="text/html; charset=EUC-KR"pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%-- <form action="/${initParam.context_root}/com/mylist.do" method="post"> --%>
   
  <style type="text/css">
table{
	width :750px;
	border-collapse: collapse;
}
table td{
	padding: 5px;
}
</style>

<h2>나의글목록</h2>

<table id="content" border="1" id="qnalist">
	<tr>
		<td width="65px" align="center">글번호</td>
		<td align="center">제목</td>
		<td width="100px" align="center">작성자</td>
		<td width="100px" align="center">작성일</td>
		<td width="60px" align="center">조회수</td>
	</tr>
	<c:forEach items="${requestScope.list }" var="board">
		<tr>
			<td>${board.no }</td>
			<td>
				<c:forEach begin="1" end="${board.relevel }" step="1">
					&nbsp;&nbsp;
				</c:forEach>
				<c:if test="${board.relevel != 0 }">
					→
				</c:if>
				<a href="/${initParam.context_root}/com/getContent2.do?no=${board.no }&page=${requestScope.pagingBean.currentPage}">
					${board.title }
				</a> 
			</td>
			<td>${board.nickname }</td>
			<td>${board.writedate }</td>
			<td align="right">${board.viewcount }</td>
		</tr>	
	</c:forEach>
	
</table>
<p>
<table>
	<tr>
		<td>		
	<%-- 	<a href="/${initParam.context_root }/com/write_form2.do">글쓰기</a><br> --%>
		<c:choose>
			<c:when test="${requestScope.pagingBean.previousPageGroup }">
		  		<a href="/${initParam.context_root  }/com/mylist.do?page=${requestScope.pagingBean.startPageOfPageGroup -1 }"> 
				◀
				</a>
			</c:when>
			<c:otherwise>
				◀
			</c:otherwise>
		</c:choose>
		<c:forEach begin="${requestScope.pagingBean.startPageOfPageGroup }"
							   end="${requestScope.pagingBean.endPageOfPageGroup }"
							   step="1"
							   var ="i">
			<c:choose>
				<c:when test="${i == requestScope.pagingBean.currentPage }">
					${i }
				</c:when>
				<c:otherwise>
	 	<a href="/${initParam.context_root }/com/mylist.do?page=${i }">${i }</a>  
				</c:otherwise>
			</c:choose>			
		</c:forEach>
		<c:choose>
			<c:when test="${requestScope.pagingBean.nextPageGroup }">
		<a href="/${initParam.context_root  }/com/mylist.do?page=${requestScope.pagingBean.endPageOfPageGroup + 1 }">  
					▶
				</a>
			</c:when>
			<c:otherwise>
				▶
			</c:otherwise>
		</c:choose>
		
		<td>
	</tr>
</table>
        
        </table>
        
        
        
        
        